<!-- Modal -->
<#include "../../select.ftl" />
<div class="modal-dialog wide" style="width: 1000px;">
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">
            <#if hrEmployee??>
                <#if hrEmployee.id??>
                    编辑
                <#else>
                    新增
                </#if>
            </#if>
        </h4>
    </div>
    <div class="modal-body">
        <div id="errorMessage"><#include "../../message.ftl" /></div>
        <form class="form-horizontal" role="form" id="hrEmployeeForm" method="post" action="${absoluteContextPath}/hr/hrEmployee/save">
            <#if hrEmployee??>
                <#if hrEmployee.id??>
                    <input type="hidden" name="id" value="${hrEmployee.id?c}"/>
                <#else>
                    <input type="hidden" name="id" value=""/>
                </#if>
            </#if>
            <div class="row">
                <div class="form-group col-md-4">
                    <label class="col-sm-4 control-label">员工号</label>
                    <div class="col-sm-6">
                        <input name="employeeId" value="${hrEmployee.employeeId!''}" type="text" class="form-control"/>
                    </div>
                </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">员工状态</label>
                <div class="col-sm-6">
                <@select name="employeeState" value="${hrEmployee.employeeState!''}" list=employeeTypeList class="form-control"/>
               </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">员工姓名</label>
                <div class="col-sm-6">
                    <input name="employeeName" value="${hrEmployee.employeeName!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">性别</label>
                <div class="col-sm-6">
                <@select name="sex" value="${hrEmployee.sex!''}" list=sexTypeList class="form-control"/>

               </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">身份证号码</label>
                <div class="col-sm-6">
                    <input name="card" value="${hrEmployee.card!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">身份证地址</label>
                <div class="col-sm-6">
                    <input name="address" value="${hrEmployee.address!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">户口所在地</label>
                <div class="col-sm-6">
                    <input name="residenceAddress" value="${hrEmployee.residenceAddress!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">民族</label>
                <div class="col-sm-6">
                    <input name="national" value="${hrEmployee.national!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">最高学历</label>
                <div class="col-sm-6">
                    <input name="record" value="${hrEmployee.record!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">毕业院校</label>
                <div class="col-sm-6">
                    <input name="school" value="${hrEmployee.school!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">专业</label>
                <div class="col-sm-6">
                    <input name="professional" value="${hrEmployee.professional!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">毕业日期</label>
                <div class="col-sm-6">
                    <input name="graduation" value="${hrEmployee.graduation!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">本人联系电话</label>
                <div class="col-sm-6">
                    <input name="phone" value="${hrEmployee.phone!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">家庭地址</label>
                <div class="col-sm-6">
                    <input name="homeAddress" value="${hrEmployee.homeAddress!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">邮寄地址</label>
                <div class="col-sm-6">
                    <input name="mailAddress" value="${hrEmployee.mailAddress!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">紧急联系人</label>
                <div class="col-sm-6">
                    <input name="contact" value="${hrEmployee.contact!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">紧急联系人电话</label>
                <div class="col-sm-6">
                    <input name="contactPhone" value="${hrEmployee.contactPhone!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">紧急联系人地址</label>
                <div class="col-sm-6">
                    <input name="contactAddress" value="${hrEmployee.contactAddress!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">工作所在地</label>
                <div class="col-sm-6">
                    <input name="workLocation" value="${hrEmployee.workLocation!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">入职日期</label>
                <div class="col-sm-6">
                    <input name="spareA" value="${hrEmployee.spareA!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-4">
                <label class="col-sm-4 control-label">转正日期</label>
                <div class="col-sm-6">
                    <input name="spareB" value="${hrEmployee.spareB!''}" type="text" class="form-control"/>
                </div>
            </div>

            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
        <button type="button" class="btn btn-primary" onclick="save();">保存</button>
    </div>
</div>
</div>
<script>
    function save() {
        $("#" + "hrEmployeeForm").ajaxSubmit({
            success:function(data) {
                data = JSON.parse(data);
                if (data.returnCode == 1) {
                    $('#myModal').modal("hide");
                    $.showMessage({parentId:"showMessage",message:"信息保存成功！",type:"success"});
                    refreshTable();
                } else {
                    $.showMessage({parentId:"errorMessage",message:"<strong>错误信息</strong>：" + data.returnMsg,type:"error"});
                }
            }
        });
    }

    $(function () {
        $("input[name=graduation]").focus(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        })
        $("input[name=contractStart]").focus(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        })
        $("input[name=contractEnd]").focus(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        })
        $("input[name=spareA]").focus(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        })
        $("input[name=spareB]").focus(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        })

        $("div[class='tooltip fade top in']").hide();
    });
</script>